package edu.zut.cs.network.Experiment3;
import javax.swing.JOptionPane;
public class Test2 {
    public static void main(String[] args) {
//        写程序从输入对话框中读入一个整数，然后输出该整数被5和6整除的情况
        String str = JOptionPane.showInputDialog("请输入一个整数：");
        int num = Integer.parseInt(str);
        if(num % 5 == 0 && num % 6 == 0){
            JOptionPane.showMessageDialog(null,
                    num+" is divisible by both 5 and 6",
                    "输出结果",JOptionPane.INFORMATION_MESSAGE);
        }
        else if(num % 5 == 0 || num % 6 == 0){
            JOptionPane.showMessageDialog(null,
                    num+" is divisible by 5 or 6, but not both",
                    "输出结果",JOptionPane.INFORMATION_MESSAGE);
        }
        else{
            JOptionPane.showMessageDialog(null,
                    num+" is not divisible by either 5 or 6",
                    "输出结果",JOptionPane.INFORMATION_MESSAGE);
        }
    }
}
